﻿using System;
using System.Collections.Generic;
using MODI;

namespace viBook.Common
{
    public static class Constant
    {

        public const int DefaultImageWith = 580;
        public const int MaxCharToTake = 100;
        public const int TakedItem = 10;
        public const int MaximunTagContent = 3;
        public const string DefaultBookUrl = "/Content/DefaultbookImage.png";
        public const string DefaultAvatarUrl = "/Content/default_avatar.jpg";
        public const string ExistBookLike = "This Book has been liked or Disliked by you";
        public const string ExisBookCommentLike = "This Comment has been liked or Disliked by you";
        public const int MaximunCommentPerChapter = 5;
        public const int MaximunBookPerPage = 3;
        public const int MaximunPopBookPage = 3;
        public const int MaximunItemsToPaging = 6;
        public const int MaximumActivitiesToPaging = 8;
        public const int MaximumShortCommentCharacters = 30;
        public const string SaveImagePath = "Images";
        public const string SaveAvatarPath = "Images/Avatar";
        /// <summary>
        /// We can't process your request at the moment, please try again later
        /// </summary>
        public const string NotSupportedLanguageErrorMessage = "We dont support your language! Please try again later";
        public const string ErrorMessage = "We can't process your request at the moment, please try again later";

        public const string StatusCreated = "Created";
        public const string StatusApproved = "Approved";
        public const string StatusBlocked = "Blocked";
        public const string ActivatePath = "/account/activate";
        public const string ResetPasswordPath = "/account/resetpassword";
        public const string BookDetailsPath = "/books/details/";
        public const string ChapterDetailsPath = "/chapters/details/";
        public const string UserAccountPath = "/account/index/";

        //Activity description
        public const string RegisteredType = "Register";
        public const string CreatedBookType = "Create book";
        public const string CommentedBookType = "Comment book";
        public const string CommentedChapterType = "Comment chapter";
        public const string LikedBookType = "Like book";
        public const string LikedChapterType = "Like chapter";
        public const string LikedBookCommentType = "Like book comment";
        public const string LikedChapterCommentType = "Like chapter comment";

        public const string RegisteredActivity = "Joined ViBook.";
        public const string CreatedBookActivity = "Uploaded new book <a href=\"{0}\">{1}</a>.";
        public const string CommentedBookActivity = "Posted a comment \"{0}\" on book <a href=\"{1}\">{2}</a>.";
        public const string CommentedChapterActivity = "Posted a comment \"{0}\" on chapter <a href=\"{1}\">{2}</a> of book <a href=\"{3}\">{4}</a>.";
        public const string LikedBookActivity = "Liked book <a href=\"{0}\">{1}</a>.";
        public const string LikedChapterActivity =
            "Liked chapter <a href=\"{0}\">{1}</a> of book <a href=\"{2}\">{3}</a>.";
        public const string LikedBookCommentActivity =
            "Liked comment of <a href=\"{0}\">{1}</a> on book <a href=\"{2}\">{3}</a>.";
        public const string LikedChapterCommentActivity =
            "Liked comment of <a href=\"{0}\">{1}</a> on chapter <a href=\"{2}\">{3}</a> of book <a href=\"{4}\">{5}</a>.";

        //todo: Set value for this param later
        public const string DefaultChapterCover = "Can't Recognize characters . Please do it manually!";
        public const string DefaultUserAvatar = "/Content/default_avatar.jpg";

        public static readonly List<Language> Languages = new List<Language>
                                                     {
                                                new Language("CHINESE SIMPLIFIED","zh-CN",MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED),
                                                new Language("CHINESE TRADITIONAL","zh-TW",MiLANGUAGES.miLANG_CHINESE_TRADITIONAL),
                                                new Language("CZECH","cs",MiLANGUAGES.miLANG_CZECH),
                                                new Language("DANISH","da",MiLANGUAGES.miLANG_DANISH),
                                                new Language("DUTCH","nl",MiLANGUAGES.miLANG_DUTCH),
                                                new Language("ENGLISH","en",MiLANGUAGES.miLANG_ENGLISH),
                                                new Language("FINNISH","fi",MiLANGUAGES.miLANG_FINNISH),
                                                new Language("FRENCH","fr",MiLANGUAGES.miLANG_FRENCH),
                                                new Language("GERMAN","de",MiLANGUAGES.miLANG_GERMAN),
                                                new Language("GREEK","el",MiLANGUAGES.miLANG_GREEK),
                                                new Language("HUNGARIAN","hu",MiLANGUAGES.miLANG_HUNGARIAN),
                                                new Language("ITALIAN","it",MiLANGUAGES.miLANG_ITALIAN),
                                                new Language("JAPANESE","jp",MiLANGUAGES.miLANG_JAPANESE),
                                                new Language("KOREAN","ko",MiLANGUAGES.miLANG_KOREAN),
                                                new Language("NORWEGIAN","no",MiLANGUAGES.miLANG_NORWEGIAN),
                                                new Language("POLISH","pl",MiLANGUAGES.miLANG_POLISH),
                                                new Language("PORTUGUESE","pt",MiLANGUAGES.miLANG_PORTUGUESE),
                                                new Language("RUSSIAN","ru",MiLANGUAGES.miLANG_RUSSIAN),
                                                new Language("SPANISH","es",MiLANGUAGES.miLANG_SPANISH),
                                                new Language("SWEDISH","sv",MiLANGUAGES.miLANG_SWEDISH),
                                                new Language("TURKISH","tr",MiLANGUAGES.miLANG_TURKISH),
                                            };

        public const int MaximunUserBook = 5;

        public const string GeneralConvertErrorMessage = "Can't Recognize characters . Please do it manually!";
        public const int MaximunPopUSer = 3;
        public const int NumberOfPopTags = 15;

        public static readonly List<string> NoReturnPaths = new List<string>
                                                              {
                                                                  "/account/accessDenied",
                                                                  "/account/activate",
                                                                  "/account/activatesuccess",
                                                                  "/account/activationrequired",
                                                                  "/account/activationsent",
                                                                  "/account/changepasswordsuccess",
                                                                  "/account/logon",
                                                                  "/account/reactivate",
                                                                  "/account/register",
                                                                  "/account/requestresetpassword",
                                                                  "/account/requireactivation",
                                                                  "/account/resetpassword",
                                                                  "/account/resetpasswordsent",
                                                                  "/account/resetpasswordsuccess",
                                                              };

        #region Account Controller Message

        /// <summary>
        /// CONTENT: Your email have already been used to register at ViBook. Please sign in normally.
        /// </summary>
        public static string EmailHasBeenRegisteredMessage =
            "Your email have already been used to register at ViBook. Please sign in normally.";

        /// <summary>
        /// CONTENT: Canceled at provider
        /// </summary>
        public static string CanceledAtProviderMessage = "Canceled at provider.";

        /// <summary>
        /// CONTENT: "The user name or password provided is incorrect."
        /// </summary>
        public static string IncorrectPasswordMessage = "The user name or password provided is incorrect.";

        /// <summary>
        /// CONTENT: You must type the letters you see.
        /// </summary>
        public const string RealPersonErrorMessage = "You must type the letters you see.";

        /// <summary>
        /// CONTENT: Email is invalid or your account has been activated.
        /// </summary>
        public const string EmailInvalidErrorMessage = "Email is invalid or your account has been activated.";

        /// <summary>
        /// CONTENT: The current password is incorrect or the new password is invalid.
        /// </summary>
        public static string PasswordErrorMessage = "The current password is incorrect or the new password is invalid.";

        /// <summary>
        /// CONTENT: User name already exists.
        /// </summary>
        public static string UsernameExistedErrorMessage = "User name already exists.";

        /// <summary>
        /// CONTENT: Your username is invalid.
        /// </summary>
        public static string UserInvalidErrorMessage = "Your username is invalid.";

        /// <summary>
        /// CONTENT: User name is required.
        /// </summary>
        public static string UsernameMissingErrorMessage = "User name is required.";

        #endregion

        /// <summary>
        /// CONTENT: Title already exists.
        /// </summary>
        public static string BookTitleExistedMessage = "Title already exists.";


        /// <summary>
        /// CONTENT: "Title is required."
        /// </summary>
        public static string BookTitleMissingErrorMessage = "Title is required.";

        /// <summary>
        /// CONTENT: "Your account has been blocked."
        /// </summary>
        public static string BlockedAccountMessage = "Your account has been blocked.";

        /// <summary>
        /// CONTENT: "Category contains books."
        /// </summary>
        public static string CategoryContainsBooks = "This category contains book(s) and you cannot delete.";

        /// <summary>
        /// CONTENT: "Content tag contains books."
        /// </summary>
        public static string ContentTagContainsBooks = "This tag contains book(s) and you cannot delete.";
    }

    public enum ControllerEnum
    {
        Account,
        Admins,
        Authors,
        Books,
        Categories,
        Chapters,
        Chaptercomments,
        Bookcomments,
        ContentTags,
        Home,
        Pages
    }
    public class Language
    {
        public Language(string displayName, string googleCodeLanguage, MiLANGUAGES modiCodeLanguage)
        {
            DisplayName = displayName;
            GoogleCodeLanguage = googleCodeLanguage;
            ModiCodeLanguage = modiCodeLanguage;
        }

        public string DisplayName { get; set; }
        public string GoogleCodeLanguage { get; set; }
        public MiLANGUAGES ModiCodeLanguage { get; set; }
    }
}
